package de.recipeminer.training;

import com.aliasi.chunk.Chunk;
import com.aliasi.chunk.Chunker;
import com.aliasi.chunk.Chunking;
import com.aliasi.dict.DictionaryEntry;
import com.aliasi.dict.MapDictionary;
import com.aliasi.dict.TrieDictionary;
import com.aliasi.dict.Dictionary;
import com.aliasi.dict.ExactDictionaryChunker;

/*
@author Georg Mühlenberg
@version 0.2
@date 25 Jan 2012
*/

public class NER_Training {
    
    static final double CHUNK_SCORE_FULL = 10.0;
    static final double CHUNK_SCORE_HIGH= 8.0;
    static final double CHUNK_SCORE_MID = 4.0;
    static final double CHUNK_SCORE_LOW = 1.0;
    static final double CHUNK_SCORE_MISMATCH = 0.0;
    
    /*
    NER stands for Named Entity Recognition.
     */

public static MapDictionary<String> generateSimpleDemoDictionary()
{
    MapDictionary<String> dictionary = new MapDictionary<String>();
    dictionary.addEntry(new DictionaryEntry<String>("Ei(er)","Ei",CHUNK_SCORE_FULL));
    dictionary.addEntry(new DictionaryEntry<String>("Eies","Ei",CHUNK_SCORE_FULL));
    dictionary.addEntry(new DictionaryEntry<String>("Eie","Ei",CHUNK_SCORE_FULL));
    
    return dictionary;
}

    public static TrieDictionary<String> generateIngredientDictionary()
    /*
    Für die Extraktion des groben Namens einer Zutat.
     */

    {
        TrieDictionary<String> dictionary = new TrieDictionary<String>();        
        
        dictionary.addEntry(new DictionaryEntry<String>("Wurstei","Ei",CHUNK_SCORE_LOW));
        dictionary.addEntry(new DictionaryEntry<String>("Senfei","Ei",CHUNK_SCORE_LOW));
        dictionary.addEntry(new DictionaryEntry<String>("Rührei","Ei",CHUNK_SCORE_MID));
        dictionary.addEntry(new DictionaryEntry<String>("Hühnerei","Ei",CHUNK_SCORE_FULL));
        dictionary.addEntry(new DictionaryEntry<String>("Ei vom Huhn","Ei",CHUNK_SCORE_FULL));

        dictionary.addEntry(new DictionaryEntry<String>("Bratkartoffel","Kartoffel",CHUNK_SCORE_HIGH));
        dictionary.addEntry(new DictionaryEntry<String>("Backkartoffel","Kartoffel",CHUNK_SCORE_HIGH));
        dictionary.addEntry(new DictionaryEntry<String>("Pellkartoffel","Kartoffel",CHUNK_SCORE_FULL));


        return dictionary;
    }
    
    public static MapDictionary<String> generateStopWordDictionary()
    {
        MapDictionary<String> dictionary = new MapDictionary<String>();
        dictionary.addEntry(new DictionaryEntry<String>("nämlich","",CHUNK_SCORE_FULL));
        dictionary.addEntry(new DictionaryEntry<String>("allenfalls","",CHUNK_SCORE_FULL));
        dictionary.addEntry(new DictionaryEntry<String>("eventuell","",CHUNK_SCORE_FULL));
        return dictionary;
    }
    
}
